import keyboard


def on_key(event):
    key = event.name.lower()
    print(f"你按下了{key}键")
print("退出请直接关闭窗口，请按下按键......")
keyboard.on_press(on_key,suppress=0)
keyboard.wait()